import request from '@/utils/request'

/**
 * 股票list
 * @param {*} data 
 * @returns 
 */
export async function stockList(data) {
    return request({
        url: '/stockListByType',
        method: 'post',
        data: data
    })
}


/**
 * 删除股票
 * @param {*} data 
 * @returns 
 */
export async function stockDelete(stockId) {
    return request({
        url: '/stock/' + stockId,
        method: 'delete',
    })
}

/**
 * 添加股票
 * @param {*} data 
 * @returns 
 */
export async function addStock(data) {
    return request({
        url: '/newStock',
        method: 'post',
        data: data
    })
}


/**
 * 关注股票
 * @param {*} data 
 * @returns 
 */
export async function attentStock({ stockId, type }) {
    return request({
        url: '/attentionStock/' + stockId + "/" + type,
        method: 'put',
    })
}

/**
 * 自选股票
 * @param {*} data 
 * @returns 
 */
export async function attentionStockList(data) {
    return request({
        url: '/attentionStockList',
        method: 'post',
        data: data
    })
}
/**
 * 股票历史数据
 * @param {*} data 
 * @returns 
 */
export async function stockHistoryData(data) {
    return request({
        url: '/stockHistory',
        method: 'post',
        data:data
    })
}

